import java.awt.GridBagConstraints
import javax.swing.JFrame
import javax.swing.JTabbedPane
import javax.swing.JTextField

fun main() {
    val frame = JFrame("工具箱")

    val tabPane = JTabbedPane()
    tabPane.addTab("清理无用图片", ClearUnusedPictures())
    tabPane.addTab("清理无用图片11", JTextField("清理1"))

    frame.apply {
        add(tabPane)
        setBounds(200, 200, 400, 400)
        isVisible = true
        defaultCloseOperation = JFrame.EXIT_ON_CLOSE
    }
}

fun gbc(x: Int, y: Int, w: Int, h: Int, action: GridBagConstraints.() -> Unit = {}) = GridBagConstraints().apply {
    gridx = x
    gridy = y
    gridwidth = w
    gridheight = h
    action()
}
